package com.hailiao.beidou.message.ui.view

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.d10ng.compose.ui.AppColor
import com.d10ng.compose.ui.AppShape

/**
 * 导航栏图标
 * @Author d10ng
 * @Date 2023/11/15 20:20
 */
@Composable
fun NavBarIcon(
    modifier: Modifier = Modifier,
    iconId: Int,
    shape: RoundedCornerShape = AppShape.RC.Cycle,
    onClick: () -> Unit = {}
) {
    Icon(
        painter = painterResource(id = iconId),
        contentDescription = null,
        tint = AppColor.Neutral.tips,
        modifier = modifier
            .padding(end = 8.dp)
            .size(40.dp)
            .clip(shape)
            .clickable { onClick() }
            .padding(8.dp)
    )
}